import vue from "@vitejs/plugin-vue";
// 帮助寻找node_modules里的包
// import nodeResolve from '@rollup/plugin-node-resolve';
import { viteMockServe } from "vite-plugin-mock";
// 压缩包
// import uglify from 'rollup-plugin-uglify';
// 配置Rollup支持CommonJS规范用以识别CommonJS规范的依赖
// import commonjs from '@rollup/plugin-commonjs';
import createAutoImport from "./auto-import.js";

export default function createVitePlugins(viteEnv, mode, isBuild = false) {
  const vitePlugins = [
    vue(),
    viteMockServe({
      mockPath: "mock",
      enable: true,
    }),
  ];
  vitePlugins.push(createAutoImport());

  // vitePlugins.push(nodeResolve());
  // vitePlugins.push(commonjs());

  return vitePlugins;
}
